package com.lance.shiro.mapper;

import com.lance.shiro.entity.IFeature;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FeatureMapper extends GenericCrudMapper<IFeature>{

    //insert
    @Insert(" insert into i_feature(name,description) values(#{name},#{description})")
    @Options(useGeneratedKeys = true)
    int insert(IFeature feature);

    //fetchAll
    @Select("select * from i_feature")
    List<IFeature> fetchAll();

    //fetchByID
    @Select("select * from i_feature where id=#{id}")
    IFeature fetchById(int id);


    //update
    @Update("update i_feature set name=#{name},description=#{description} where id=#{id}")
    int  update(IFeature feature);

    //delete
    @Update("delete from i_feature where id=#{id} ")
    int delete(int id);
}
